/*
 * @Title: 选择城市模块
 * @Created by: gsjPC 
 */
<template>
	<view>
		<view :style="{marginTop:csMarginTop + 'px'}">
			<city-select
				 @cityClick="cityClick" 
				 :activeCity="activeCity" 
				 :hotCity="hotCity" 
				 :histroyCity="histroyCity"
				 :obtainCitys="obtainCitys" 
				 :isSearch="true" 
				 ref="citys">
			 </city-select>
		</view>
	</view>
	
</template>

<script>
	import citySelect from '@/components/city-select/city-select.vue'
	const cityData = require('../../../common/citys')
	export default{
		components:{
			citySelect,
		},
		data(){
			return{
				//当前城市
				activeCity: {
					'cityCode': '',
					'cityName':this.$store.state.localPosition,
				},
				//热门城市
				hotCity: [
					{
						'cityCode': '110100',
						'cityName': '北京',
						// 'hotImg':'/static/glBan.png'
					},
					{
						'cityCode': '110100',
						'cityName': '上海',
					},
					{
						'cityCode': '',
						'cityName': '厦门',
					},
					
				],
				// 历史搜索
				histroyCity:[
					{
						'cityCode': '',
						'cityName': '广州',
					},
					{
						'cityCode': '',
						'cityName': '深圳',
					},
					{
						'cityCode': '',
						'cityName': '成都',
					},
					{
						'cityCode': '',
						'cityName': '海南',
					},
					{
						'cityCode': '',
						'cityName': '新疆',
					},
				],
				obtainCitys:cityData.default//显示的城市数据
			}
		},
		methods: {
			cityClick(item) {
				console.log(item.cityName);
				this.$store.commit('localPositionUpdata',item.cityName)
				uni.navigateBack({
					delta:1
					// url:'/pages/gonglue/myselfTourNote/writeTourNote?cityName=' + item.cityName
				})
			}
		},
		computed:{
			csMarginTop(){
				return global.statusBarHeight
			}
		}
	}
</script>

<style>
</style>
